import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//import { ElIcon } from 'element-plus'
import App from './App.vue'
import router from './router'
import store from './store'


//导入全局样式表
import './assets/css/global.css'
import axios from 'axios'

//import './plugins/element.js'
//import vueConfig from 'vue.config'
//createApp(App).use(store).use(router).use(Form).use(FormItem).mount('#app')

//配置请求的根路径

const app = createApp(App)
axios.defaults.baseURL='/api'
//axios请求拦截
axios.interceptors.request.use(config=>{
  console.log(config)
  //为请求头对象，添加token验证的Authorization字段
  config.headers.Authorization=window.sessionStorage.getItem('token')
  return config
})
app.config.globalProperties.$http = axios




app.component(
    // the registered name
    'MyComponent',
    // the implementation
    {
      /* ... */
    }
  )
app.use(store)
app.use(router)
app.use(ElementPlus)
app.mount('#app')

